<?php
namespace api\modules\ua\models;

use Yii;
use yii\db\ActiveRecord;
use yii\db\Exception;
use yii\helpers\ArrayHelper;

class Uuid extends ActiveRecord
{
    public static function getDb(){return Yii::$app->ua;}
    public static function tableName(){return 'shops_uuid';}

    public function fields()
    {
        $fields = parent::fields();
        return $fields;
    }

    public function rules()
    {
        return [
            [['uuid'], 'string'],
            [['uuid'], 'unique'],
        ];
    }

    public function create($uuid)
    {
        $this->uuid        = $uuid;
        $this->save();
    }

    // 获取单条记录
    public function getOne($uuid){
        return self::findOne(['uuid'=>$uuid]);
    }


}
